/**
 * 模态框
 */
module.exports = function ($scope, $state, $stateParams,$resource) {
	/* 分页
     * ========================================= */
    $scope.maxSize = 5;             //最多显示多少个按钮
    $scope.currentPage = 1;      //当前页码
    $scope.itemsPerPage = 10         //每页显示几条
	$scope.d={};
	 

	$scope.aaa = function () {
       var para = {
        //    ta:1, 
            pageNo:$scope.currentPage, 
            pageSize:$scope.itemsPerPage,
			order_code : $scope.order_code,
			product_id : $scope.product_id,
			upplier_check_state : $scope.d.upplier_check_state,
			product_name : $scope.product_name,
			name : $scope.name,
			mobile : $scope.mobile,
			supplier_product_name : $scope.supplier_product_name,
			tour_date : $scope.tour_date,
			pay_state : $scope.d.pay_state
        };
		// console.log(para);
        $resource('/api/ac/lc/setUpNoticesService/findSetUpList', {}, {}).
			save(para, function(res){
                if(res.errcode === 0 || res.errcode === 10003){
					$scope.a=res.data.results;
					$scope.totalItems = res.data.totalRecord;
                	
                }else{
                    alert(res.errmsg);
                }
            });

    };
	$scope.aaa();

			$scope.b= '0';
			$scope.c = '';
			$scope.show = function(index){
				console.log('进来了');
				if($scope.b==0){
					$scope.b='1',
					$scope.c=index
				}else if($scope.b==1){
					if($scope.c!=index){
						$scope.c=index
					}else{
						$scope.b='0',
						$scope.c=index
					}	
				}	
			};

			$scope.psarr=[
				{name:'请选择',value:''},
                {name:'未支付',value:'0'},
                {name:'已支付',value:'1'},
               
            ]

			$scope.ucsarr=[
				{name:'请选择',value:''},
                {name:'未审核',value:'0'},
                {name:'已审核',value:'1'},
				{name:'已驳回',value:'2'},
               
            ]

			
			$scope.search=function(){
			var dic = {
				order_code : $scope.order_code,
				product_id : $scope.product_id,
				upplier_check_state : $scope.d.upplier_check_state,
				product_name : $scope.product_name,
				name : $scope.name,
				mobile : $scope.mobile,
				supplier_product_name : $scope.supplier_product_name,
				tour_date : $scope.tour_date,
				pay_state : $scope.d.pay_state
			}

				$resource('/api/ac/lc/setUpNoticesService/findSetUpList', {}, {}).save(dic, function(res){
                if(res.errcode === 0 || res.errcode === 10003){
					$scope.a=res.data.results;
                	$scope.totalItems = res.data.totalRecord;
                }else{
                    alert(res.errmsg);
                }
            });
		}
};
